import request from "@/utils/request"
/**
 * 获取小区列表总页数
 */
export function getCommunityListTotalPage() {
	let sentPageNum = 1
	let sentPageSize = 10
	const datas = {
		communityName: "",
		nickname: "",
		phonenumber: ""
	}
	return request({
		url: '/system/community/list?pageNum=' + sentPageNum + '&pageSize=' + sentPageSize,
		method: 'post',
		data: datas
	})
}

/**
 * 获取小区列表
 * @description 分页查询小区表数据，需要在url后加入pageNum及PageSize：/list?pageNum={pageNum}&pageSize={pageSize}；搜索时，需要以JSON格式传入请求参数中的所需搜索值，可全空
 * @url /p-h-broadband/system/community/list
 */
export function getCommunityListApi(data,totalPage) {
	console.log(data)
	const datas = {
		communityName: data.communityName,
		nickname: data.nickname,
		phonenumber: data.phonenumber
	}
	return request({
		url: '/system/community/list?pageNum=' + 1 + '&pageSize=' + totalPage,
		method: 'post',
		data: datas
	})
}

/**
 * 获取某个小区的房屋列表
 * @description 获取当前用户对应的树形房屋列表，搜索时，需要以JSON格式入请求参数中的所需搜索值，可全空
 * @url /p-h-broadband/system/community/treeList
 */
export function getPostCommunityTreeList(cName) {
	cName = cName ? cName : ''
	const datas = {
		broadbandNumber: "",
		broadbandStatus: "",
		buildingNumber: "",
		communityManager: "",
		communityManagerPhone: "",
		communityName: cName,
		floorNumber: "",
		nickname: "",
		phonenumber: "",
		roomNumber: ""
	}
	console.log(datas);
	return request({
		url: '/system/community/treeList',
		method: 'post',
		data: datas
	})
}